<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>购物车-商品详细页</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

hr {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 20px 0;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}
</style>
</head>
<body>
    <h2>购物车-商品详细页</h2>
    <hr>
    <p>商品名称：{{ products.product.name }}</p>
    <p>当前数量：{{ products.quantity }}</p>
    <p>总价：{{ total_price }}元</p>
    <p>收藏时间：{{ products.add_at|date:"Y年-m月-d日 H:i:s" }}</p>
    <hr>
    <form method="post" action="{% url 'cart:cart_update' products.id %}">
        {% csrf_token %}
        <input type="number" name="quantity" value="{{ products.quantity }}" min="1">
        <button type="submit">更新数量</button>
    </form>
    <a href="{% url 'cart:cart_delete' products.id %}" class="btn">删除该商品</a>
</body>
</html>